package com.xs.bookspoststation.UserActivity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.xs.bookspoststation.AdminActivity.AdminActivity;
import com.xs.bookspoststation.R;

public class OperateUserActivity extends AppCompatActivity {

    //定义对象
    private Button addbtn,lookbtn,backbtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_operate_user);
        //绑定控件
        //添加用户按钮
        addbtn = (Button)findViewById(R.id.button1_add);
        //查看用户按钮
        lookbtn = (Button)findViewById(R.id.button2_select);
        //返回按钮
        backbtn = (Button)findViewById(R.id.button3_back);

        addbtn.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View arg0) {
                Intent intent = new Intent(OperateUserActivity.this,AddUserActivity.class);
                Toast.makeText(getApplicationContext(), "添加用户界面", Toast.LENGTH_LONG).show();
                startActivity(intent);
            }});
        lookbtn.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View arg0) {
                Intent intent=new Intent(OperateUserActivity.this,UserViewActivity.class);
                Toast.makeText(getApplicationContext(), "查看用户信息界面", Toast.LENGTH_LONG).show();
                startActivity(intent);
            }});
        backbtn.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View arg0) {
                Intent intent = new Intent(OperateUserActivity.this, AdminActivity.class);
                Toast.makeText(getApplicationContext(), "返回上一页", Toast.LENGTH_LONG).show();
                startActivity(intent);
            }});
    }
}
